package com.aba.im.ui;
import javax.swing.*;
import java.awt.*;

public class OptimizedSwingUI extends JFrame {

    public OptimizedSwingUI() {
        setTitle("优化后的Swing界面");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(400, 300);

        // 创建组件
        JLabel titleLabel = new JLabel("聊天界面");
        JTextArea chatArea = new JTextArea();
        JTextField inputField = new JTextField();

        // 使用BorderLayout布局
        setLayout(new BorderLayout());
        add(titleLabel, BorderLayout.NORTH);
        add(chatArea, BorderLayout.CENTER);
        add(inputField, BorderLayout.SOUTH);

        setVisible(true);
    }

    public static void main(String[] args) {
        new OptimizedSwingUI();
    }
}

